package com.storm.effects.easing
{
	public class Twinkle {
		public function Twinkle() {
		}
		
		public static function easeIn(t:Number, b:Number, c:Number, d:Number):Number {
			return (1 - Math.cos((t / d) * Math.PI)) * (c / 2) + b;
		}
		
		public static function easeOut(t:Number, b:Number, c:Number, d:Number):Number {
			return (Math.cos((t / d) * Math.PI) + 1) * (c / 2) + b;
		}
		
		public static function easeInOut(t:Number, b:Number, c:Number, d:Number):Number {
			var halfD:Number = d * 0.5;
			if (t <= halfD) {
				return easeIn(t, b, c, halfD)
			} else {
				return easeOut(t - halfD, b, c, halfD);
			}
		}
		
		public static function easeNone(t:Number, b:Number, c:Number, d:Number):Number {
			return c * t / d + b;
		}
	}
}